<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>学生管理系统Demo</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js"></script>
    <link rel="stylesheet" href="css/index.css">
</head>
<body>
    <div id="vue-app">
        <!-- 上部分内容，添加系统 -->
        <fieldset>
            <legend>学生管理系统</legend>
            <div>
                <span>姓名：</span>
                <input type="text" name="" id="" placeholder="请输入姓名" v-model="newStudent.name">
            </div>
            <div>
                <span>年龄：</span>
                <input type="text" name="" id="" placeholder="请输入年龄" v-model="newStudent.age">
            </div>
            <div>
                <span>性别：</span>
                <select name="" id="" v-model="newStudent.sex">
                    <option value="男">男</option>
                    <option value="女">女</option>
                </select>
            </div>
            <div>
                <span>手机：</span>
                <input type="text" name="" id="" placeholder="请输入手机号" v-model="newStudent.phone">
            </div>
            <button @click="createNewStudent()">添加信息</button>
        </fieldset>
        <!-- 下部分内容，展示删除系统 -->
        <table >
            <thead>
                <tr>
                    <td>姓  名</td>
                    <td>年  龄</td>
                    <td>性  别</td>
                    <td>手  机</td>
                    <td>操  作</td>
                </tr>
            </thead>
            <tbody>
                <tr v-for="(item, index) in persons" :key="index">
                    <td>{{item.name}}</td>
                    <td>{{item.age}}</td>
                    <td>{{item.sex}}</td>
                    <td>{{item.phone}}</td>
                    <td><button @click="deleteStudent(index)">删除</button></td>
                </tr>
            </tbody>
        </table>
    </div>
</body>
<script src="js/app.js"></script>

</html>